class asteroid {
  constructor(board) {
    this.board = board;
    this.ctx = board.ctx
    this.index = 960
    this.id = board.id
    this.asteroidCont = {}
    this.imageRandom = Math.ceil(Math.random() * 5)
    this.image = images[`star${this.imageRandom}`];
    this.random = Math.random() * 525;
    this.frameid = null;
  }
  // 创建小行星
  draw() {
    this.index -= this.imageRandom
    this.ctx.drawImage(this.image, this.index, this.random, 50 * this.imageRandom, 50 * this.imageRandom)
    if (this.index < -250) {
      delete this.board.asteroidObj[this.id];
    }
  }
}
export { asteroid }